
#include "TK.h"

int main(int argc,char* argv[]){
	if(argc<2)
	{
		printf("usage: link\n");
		return 0;
	}
	Node* head = (Node*)malloc(sizeof(Node*));
	head->next = NULL;
	Node* pend = head;
	int i = 1;
	while(i<argc)
	{
		Node* pnew = (Node*)malloc(sizeof(Node));
		pnew->data = *argv[i++];
		pnew->next = NULL;
		pend->next = pnew;
		pend = pnew;
	}	
	head = head->next;
	Node* mid = middle(head);
	if(argc % 2 == 0)
	printf("odd link, the middle node is %c .\n",mid->data);	
	else
	printf("even link, the middle node is %c and %c .\n",mid->data,mid->next->data);
	return 0;
}
